package com.xjtu.chapter07.listener;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/21 16:13
 */
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class ListenDemo2 {
    public static void main(String[] args) {

        Frame frame = new Frame("这里测试WindowListener");

        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        frame.setBounds(200,200,500,300);
        frame.setVisible(true);
    }
}